4 Digit 7 Segment LED Display Module Wiki - DFRobot

DFR0645 Gravity: 4/8-Digital LED Segment Display Module DFR0645 Gravity: 4/8-Digital LED Segment Display Module

Introduction

This 4-digit 7 segment display module has two colors to choose: red and green. It supports 8-level brigthness adjustment and can be drived via two normal I/O ports. Standard IIC pins, compatible with Gravity interface, free from MCU scanning.

Specification

Pinout

DFR0645 Gravity: 4/8-Digital LED Segment Display Module Pinout
Name Function
SDA Date Line
SCL Control Line
GND Positive
VCC Negative

Communication Description

IIC Communication

The data of microprocessor communicate with the LED driver control IC via two-line bus interface. During data input, DIN signal must keep unchanged when CLK is at high level. Only when CLK clock signal is at low level can DIN signal be changed. The condition of starting data input is that DIN changes from high to low when CLK is at high level, and its condition of ending is that DIN changes from low to high when CLK is at high level.

The operation of writing LED display data shall follow the principle of “from low bit to high bit” of display address and “from low bit to high bit” of data byte.

DFR0645 Gravity: 4/8-Digital LED Segment Display Module IIC Communication

Slave Address

The slave address of the LED display is 0x48.

Display Register Address

REG0 REG1 REG2 REG3
68H 6AH 6CH 6EH

Tutorial with Arduino

Connection Diagram

DFR0645 Gravity: 4/8-Digital LED Segment Display Module Connection Diagram

Sample Code

Click to download Library File and Example. How to install a library?

/*!
 * @file ledPrint.ino
 * @brief Display experiment of the digital tube
 * @n Experiment phenomenon: The digital tube displays "HALO",and in one second, displays "H.A.L.O.", then show value of the variable val after one second
 * @copyright   Copyright (c) 2010 DFRobot Co.Ltd (http://www.dfrobot.com)
 * @license     The MIT License (MIT)
 * @author [Actor](wenzheng.wang@dfrobot.com),[TangJie](jie.tang@dfrobot.com)
 * @version  V1.0.1
 * @data  2022-03-21
 * @url https://github.com/DFRobot/DFRobot_LedDisplayModule
 */
# include "DFRobot_LedDisplayModule.h"
/**
 * DFRobot_LedDisplayModule Constructor
 * Parameter &wire  Wire
 * In default, the IIC address of 8 bits digital tube is 0xE0
 * The IIC address of 8 bits digital tube can be changed by combining A1 and A0
 * 1  1  1  0  | 0  A1 A0 0
 * 1  1  1  0  | 0  0  0  0    0xE0
 * 1  1  1  0  | 0  0  1  0    0xE2
 * 1  1  1  0  | 0  1  0  0    0xE4
 * 0  0  1  0  | 0  1  1  0    0xE6
 */ 
//DFRobot_LedDisplayModule LED(&Wire, 0xE0);

/**
 * DFRobot_LedDisplayModule Constructor
 * In default, the IIC address of 4 bits digital tube is 0x48 
 */
DFRobot_LedDisplayModule LED(&Wire, 0x48);

void setup() 
{
  Serial.begin(115200);
  /*Wait for the chip to be initialized completely, and then exit*/
  while(LED.begin(LED.e4Bit) != 0)
  {
    Serial.println("Failed to initialize the chip , please confirm the chip connection!");
    delay(1000);
  }

  /**
   * Set the display area to 1, 2, 3, 4
   * It can show 4 bits, the region of each parameter is 1~4 
   * Please resend the display value if the display area is changed
   */
  LED.setDisplayArea(1,2,3,4);
}

void loop() 
{
  /**
   * Display "HALO"
   * At present, it only supports showing the numbers 0 to 9, capital letters A, B, C, D, E, F, H, L, O, P, U and dash-,
   * and you can also bring decimal points, such as "0." "9." "A." "-."
   */
  LED.print("H","A","L","O");
  delay(1000);

  LED.print("H.","A.","L.","O."); 
  delay(1000);

  /**
   * Show a viriable value
   * The viriable could be both integer and decimal
   * Here it can be compatible with the sensor return value, such as temperature, humdity and so on
   */
  double val = 13.25;
  LED.print(val);
  delay(1000);
}

Result

DFR0645 Gravity: 4/8-Digital LED Segment Display Module Result

FAQ

For any questions, advice or cool ideas to share, please visit the DFRobot Forum

More Documents